]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix search handling when typing multiple searches in the search box
authorNohemi Fernandez <nf68@cornell.edu>
Thu, 7 Apr 2011 23:10:24 +0000 (19:10 -0400)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 15 Apr 2011 17:42:08 +0000 (19:42 +0200)
In the current implementation of the search entry, when replacing a
selected search term with another term, the first character of the
replacement is prepended to the hint text rather than starting a new
search. This fix makes sure that the focus is not lost when changing
the selected search term.

https://bugzilla.gnome.org/show_bug.cgi?id=636341

js/ui/viewSelector.js

index 00ec8a4086ab44460c49d5c299f7010cc998b64f..29262dcf39e8fe1d911c43be0d61dedf7e543f73 100644 (file)
@@ -162,7 +162,14 @@ SearchTab.prototype = {
     hide: function() {
         BaseTab.prototype.hide.call(this);
 
-        this._reset();
+        // Leave the entry focused when it doesn't have any text;
+        // when replacing a selected search term, Clutter emits
+        // two 'text-changed' signals, one for deleting the previous
+        // text and one for the new one - the second one is handled
+        // incorrectly when we remove focus
+        // (https://bugzilla.gnome.org/show_bug.cgi?id=636341) */
+        if (this._text.text != '')
+            this._reset();
     },
 
     _reset: function () {